<?php
if (!defined('TYPO3_MODE')) {
	die ('Access denied.');
}

if(!defined($_EXTKEY)) $_EXTKEY = 'mfwc_shoolinfos';


$TCA['tx_mfwcshoolinfos_zone'] = array(
	'ctrl' => array(
		'title'     => 'LLL:EXT:mfwc_shoolinfos/locallang_db.xml:tx_mfwcshoolinfos_zone',		
		'label'     => 'title',	
		'rootLevel' => 1,
		'default_sortby' => 'ORDER BY uid',	
		'delete' => 'deleted',	
		'enablecolumns' => array(		
			'disabled' => 'hidden',
		),
		'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
		'iconfile'          => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_mfwcshoolinfos.gif',
	),
);

$TCA['tx_mfwcshoolinfos_city'] = array(
	'ctrl' => array(
		'title'     => 'LLL:EXT:mfwc_shoolinfos/locallang_db.xml:tx_mfwcshoolinfos_city',		
		'label'     => 'title',	
		'rootLevel' => 1,
		'default_sortby' => 'ORDER BY uid',	
		'delete' => 'deleted',	
		'enablecolumns' => array(		
			'disabled' => 'hidden',
		),
		'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
		'iconfile'          => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_mfwcshoolinfos.gif',
	),
);

$TCA['tx_mfwcshoolinfos_county'] = array(
	'ctrl' => array(
		'title'     => 'LLL:EXT:mfwc_shoolinfos/locallang_db.xml:tx_mfwcshoolinfos_county',		
		'label'     => 'title',	
		'rootLevel' => 1,
		'default_sortby' => 'ORDER BY uid',	
		'delete' => 'deleted',	
		'enablecolumns' => array(		
			'disabled' => 'hidden',
		),
		'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
		'iconfile'          => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_mfwcshoolinfos.gif',
	),
);



$tempColumns = array(


	'gender' => Array (
		'exclude' => 0,
		'label' => 'LLL:EXT:mfwc_shoolinfos/locallang_db.xml:fe_users.gender',
		'config' => Array (
			'type' => 'radio',
			'items' => Array (
				Array('LLL:EXT:mfwc_shoolinfos/locallang_db.xml:fe_users.gender.I.0', '0'),
				Array('LLL:EXT:mfwc_shoolinfos/locallang_db.xml:fe_users.gender.I.1', '1')
			),
		)
	),

	'zone' => Array (
		'exclude' => 0,
		'label' => 'LLL:EXT:mfwc_shoolinfos/locallang_db.xml:fe_users.zone',
		'config' => array(
			'type' => 'select',	
			'items' => array(
				array('', 0),
			),
			'foreign_table' => 'tx_mfwcshoolinfos_zone',	
			'foreign_table_where' => 'ORDER BY tx_mfwcshoolinfos_zone.uid',	
			'size' => 1,	
			'minitems' => 0,
			'maxitems' => 1,
		)
	),
	
	
	'city' => Array (
		'exclude' => 0,
		'label' => 'LLL:EXT:mfwc_shoolinfos/locallang_db.xml:fe_users.city',
		'config' => array(
			'type' => 'select',	
			'items' => array(
				array('', 0),
			),
			'foreign_table' => 'tx_mfwcshoolinfos_city',	
			'foreign_table_where' => ' AND tx_mfwcshoolinfos_city.parent_id = ###REC_FIELD_zone### ORDER BY tx_mfwcshoolinfos_city.uid',	
			'size' => 1,	
			'minitems' => 0,
			'maxitems' => 1,
		)
	),
	
	
	'tx_mfwcshoolinfos_county' => array(		
		'exclude' => 0,		
		'label' => 'LLL:EXT:mfwc_shoolinfos/locallang_db.xml:fe_users.tx_mfwcshoolinfos_county',		
		'config' => array(
			'type' => 'select',	
			'items' => array(
				array('', 0),
			),
			'foreign_table' => 'tx_mfwcshoolinfos_county',	
			'foreign_table_where' => ' AND tx_mfwcshoolinfos_county.parent_id = ###REC_FIELD_city### ORDER BY tx_mfwcshoolinfos_county.uid',	
			'size' => 1,	
			'minitems' => 0,
			'maxitems' => 1,
		)
	),
	
	
	'tx_mfwcshoolinfos_qq' => array(		
		'exclude' => 0,		
		'label' => 'LLL:EXT:mfwc_shoolinfos/locallang_db.xml:fe_users.tx_mfwcshoolinfos_qq',		
		'config' => array(
			'type' => 'input',	
			'size' => '30',
		)
	),
	'tx_mfwcshoolinfos_weibo' => array(		
		'exclude' => 0,		
		'label' => 'LLL:EXT:mfwc_shoolinfos/locallang_db.xml:fe_users.tx_mfwcshoolinfos_weibo',		
		'config' => array(
			'type' => 'text',
			'wrap' => 'OFF',
			'cols' => '30',	
			'rows' => '5',
		)
	),
	
	'tx_mfwcshoolinfos_email' => array(		
		'exclude' => 0,		
		'label' => 'LLL:EXT:mfwc_shoolinfos/locallang_db.xml:fe_users.tx_mfwcshoolinfos_email',		
		'config' => array(
			'type' => 'input',	
			'size' => '30',
		)
	),
	'tx_mfwcshoolinfos_telephone' => array(		
		'exclude' => 0,		
		'label' => 'LLL:EXT:mfwc_shoolinfos/locallang_db.xml:fe_users.tx_mfwcshoolinfos_telephone',		
		'config' => array(
			'type' => 'input',	
			'size' => '30',
		)
	),

	
);


t3lib_div::loadTCA('fe_users');
t3lib_extMgm::addTCAcolumns('fe_users',$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes('fe_users','gender','','after:name');
t3lib_extMgm::addToAllTCAtypes('fe_users','zone','','before:city');
t3lib_extMgm::addToAllTCAtypes('fe_users','tx_mfwcshoolinfos_county','','after:city');

t3lib_extMgm::addToAllTCAtypes('fe_users','tx_mfwcshoolinfos_qq, tx_mfwcshoolinfos_weibo','','before:email');

$TCA['fe_users']['ctrl']['requestUpdate']=$TCA['fe_users']['ctrl']['requestUpdate'].',zone,city';
?>